<include target="_header.html" />
{@
	$year = date("Y");
	$month = date("m");
	$date = date("d");
}
<script type="text/javascript">
	function changeIframe() {
		form = document.forms[0];

		if(form.category_srl.selectedIndex == 1 ) {
			document.getElementById("content_frame").contentWindow.location.href = "http://www.skku.ac.kr/e-home-s/week_menu2/read.jsp?mode=view&list_gb=7&yyyy={$year}&mm={$month}&dd={$date}";
		}
		else if(form.category_srl.selectedIndex == 2) {
			document.getElementById("content_frame").contentWindow.location.href = "http://www.skku.ac.kr/e-home-s/week_menu2/read.jsp?mode=view&list_gb=6&yyyy={$year}&mm={$month}&dd={$date}";
		}
		else if(form.category_srl.selectedIndex == 3) {
			document.getElementById("content_frame").contentWindow.location.href = "http://www.skku.ac.kr/e-home-s/week_menu2/read.jsp?mode=view&list_gb=5&yyyy={$year}&mm={$month}&dd={$date}";
		}
		else if(form.category_srl.selectedIndex == 4) {
			document.getElementById("content_frame").contentWindow.location.href = "http://dorm.skku.edu:8181/diningboard1/list.jsp?b_code=6";
		}
	}
	
	function changeTitle() {
		$(".date_title").attr("value", form.selected_date.value);
	}
</script>

{@
	$yearStr = date("Y");
	$monthStr = date("m");
	$dateStr = date("d");
}



<form action="./" method="post" onsubmit="return procFilter(this, window.insert)" class="board_write">
	<input type="hidden" name="mid" value="{$mid}" />
	<input type="hidden" name="content" value="{$oDocument->getContentText()}" />
	<input type="hidden" name="document_srl" value="{$document_srl}" />
	<input type="hidden" name="allow_comment" value="Y" />
	<input type="hidden" name="allow_trackback" value="Y" />
	<div class="write_header">
		<select name="selected_date" class"selected_date" onchange="changeIframe(); changeTitle();">
			<option value="">날짜선택</option>
			<!--@for($temp_i=0; $temp_i<7; $temp_i++)-->
				<!--@if($dateStr+$temp_i<10)-->
					<option value="{$yearStr}-{$monthStr}-0{$dateStr+$temp_i}">{$yearStr}-{$monthStr}-0{$dateStr+$temp_i}</option>
				<!--@else-->
					<option value="{$yearStr}-{$monthStr}-{$dateStr+$temp_i}">{$yearStr}-{$monthStr}-{$dateStr+$temp_i}</option>
				<!--@end-->
			<!--@end-->
		</select>
	
		<!--@if($module_info->use_category=="Y")-->
		<select name="category_srl" class="category" onchange="changeIframe();">
			<option value="">{$lang->category}</option>
			<!--@foreach($category_list as $val)-->
			<option <!--@if(!$val->grant)-->disabled="disabled"<!--@endif--> value="{$val->category_srl}" <!--@if($val->grant&&$val->selected||$val->category_srl==$oDocument->get('category_srl'))-->selected="selected"<!--@endif-->>
				{str_repeat("&nbsp;&nbsp;",$val->depth)} {$val->title} ({$val->document_count})
			</option>
			<!--@endforeach-->
		</select>
		<!--@endif-->
		<input cond="$oDocument->getTitleText()" type="text" name="title" class="iText" title="{$lang->title}" value="{htmlspecialchars($oDocument->getTitleText())}" />
		<input cond="!$oDocument->getTitleText()" type="text" name="title" class="date_title" title="{$lang->title}" />
		봇 파이팅!
		<iframe id="content_frame" name="content_frame" height="400px" width="100%" frameborder=0>
		</iframe>
	</div>
    <div class="write_editor">
		{$oDocument->getEditor()}
	</div>
	<div class="write_author" cond="!$is_logged">
		<label for="userName">{$lang->writer}</label>
		<input type="text" name="nick_name" id="userName" class="iText userName" value="{htmlspecialchars($oDocument->get('nick_name'))}" />
		<label for="userPw">{$lang->password}</label>
		<input type="password" name="password" id="userPw" class="iText userPw" />
		<label for="homePage">{$lang->homepage}</label>
		<input type="text" name="homepage" id="homePage" class="iText homePage" value="{htmlspecialchars($oDocument->get('homepage'))}" />
    </div>
	<div class="btnArea">
		<input type="submit" value="{$lang->cmd_registration}" class="btn" />
	</div>
</form>
<include target="_footer.html" />
